/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dao.util;

import java.util.List;
import model.pojo.NhomWsBanHang;
import org.hibernate.HibernateException;
import org.hibernate.Session;

/**
 *
 * @author LaiHuynh
 */
public class NhomWsBanHangDAO {
    public static List<NhomWsBanHang> layDanhWsBanHang() {
        List<NhomWsBanHang> ds = null;
        Session session = HibernateUtil.getSessionFactory().openSession();
        try {
            String hql = "select dm from NhomWsBanHang dm order by dm.maDanhMuc";
            org.hibernate.Query query = session.createQuery(hql);
            ds = query.list();
        } catch (HibernateException ex) {
            //Log the exception
            System.err.println(ex);
        } finally {
            session.close();
        }   
        return ds;        
    }
}
